package com.attilax.log;

import java.io.PrintStream;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class LogUtil {
	
	public static void main(String[] args) {System.out.println("11");
		LogUtil.redirectSystemOutAndErrToLog_slf4j();
		System.out.println("22");
	}
	
	   
    public static void redirectSystemOutAndErrToLog_slf4j() {  
    	Logger logger = LoggerFactory.getLogger("LogUtil");  
    //	 Logger logger = LoggerFactory.getLogger("Com_jacob_office_Util");
        PrintStream printStreamForOut = StdOutErrRedirector4slf4j.createLoggingWrapper(System.out, false,logger);  
        PrintStream printStreamForErr = StdOutErrRedirector4slf4j.createLoggingWrapper(System.out, true,logger);  
        System.setOut(printStreamForOut);  
        System.setErr(printStreamForErr);  
    } 

}
